import {fetch} from 'utils/fetch';


/***
 * POST 调用通览identify接口验证金税盘签名(网页门户调用)
 * @returns {*}
 */
export function assistantIdentify(data) {
  return fetch({
      url: '/assistant/identify',
      method: 'post',
      data,
    });
}

/***
 * POST 获取服务端serverHello(网页门户调用)
 * @returns {*}
 */
export function assistantServerHello(data) {
	return fetch({
		url: '/assistant/serverHello',
		method: 'post',
		data,
	});
}


/***
 * POST 助手初始化相关
 * @returns {*}
 */
export function doFunction(data) {
	return fetch({
		url: '/DoFunction',
		method: 'post',
		baseURL:'https://127.0.0.1:56789',
		data
	});
}

/***
 * POST 获取通览数据同步任务(网页门户调用)
 * @returns {*}
 */
export function getAssistantSyncTask(data) {
	return fetch({
		url: '/assistant/getAssistantSyncTask',
		method: 'post',
		data,
	});
}

/***
 * POST 提交同步任务(网页门户调用)
 * @returns {*}
 */
export function isNeedSyncTask(businessType) {
	return fetch({
		url: '/assistant/isNeedSyncTask?businessType='+businessType,
		method: 'post'
	});
}

//临时 跳过拉取数据
export function getSyncTask(uscCode) {
	return fetch({
		url: '/zt/getSyncTask?uscCode='+uscCode,
		method: 'post'
	});
}


//中天金税盘认证
export function approveSmrz(uscCode,loginAccount,tenantName) {
	return fetch({
		url: '/zt/approve?uscCode='+uscCode+'&phone='+loginAccount+'&tenantName='+tenantName,
		method: 'post'
	});
}


//是否存在1个月内拉取的历史退税数据
export function isHistoricalTaxRebate(uscCode) {
	return fetch({
		url: '/zt/isHistoricalTaxRebate?uscCode='+uscCode,
		method: 'post'
	});
}

//退税助手初始化
export function ztyun(baseURL,params) {
	return fetch({
		method: 'post',
		baseURL: baseURL,
		data: params,
		dataType: 'json',
		headers:{
			'Content-Type': 'text/plain;charset=UTF-8',
		}
	});
}
//更新授信第一步
export function assistantApprove(data) {
	return fetch({
		url: '/zt/assistantApprove',
		method: 'post',
		data
	});
}

